/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.volatileshooter.entity;

import java.util.ArrayList;
import java.util.List;

/**
 * 
 * @author Ahmed
 */
public class Entity {

	private List<EntityController> controllers;

	public void addController(EntityController controller) {
		if (controllers == null) {
			controllers = new ArrayList<EntityController>();
		}

		controllers.add(controller);
	}

	public void removeController(EntityController controller) {
		if (controllers != null) {
			controllers.remove(controller);
		}
	}

	public List<EntityController> getControllers() {
		return controllers;
	}

	public void update(float time) {
		if (controllers != null) {
			for (int i = controllers.size(); --i >= 0;) {
				controllers.get(i).update(time, this);
			}
		}
	}
}
